package im.vinci.server.headphone.domain;

import java.util.HashMap;

/**
 * Created by mingjie on 17/4/11.
 */
public enum LanguageType {
    ENGLISH("en"), CHINESE("cn");

    private String code;

    private static HashMap<String, LanguageType> map = new HashMap<String, LanguageType>();

    static {
        for (LanguageType languageType : LanguageType.values()) {
            map.put(languageType.code, languageType);
        }
    }

    private LanguageType(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public static LanguageType getLanguageType(String code) {
        return map.get(code);
    }


}
